
function [failure, success] = bayes_2(classA1, classA2, classTest, numClassTest)

y1(1:length(classA1)) = 1;
y2(1:length(classA2)) = 2;
yTest(1:length(classTest)) = numClassTest;

s1 = size(classA1);
s2 = size(classA2);
sTest = size(classTest);

data1 = struct('X', classA1', 'y', y1, 'dim', s1(2), 'num_dat', length(y1));
data2 = struct('X', classA2', 'y', y2, 'dim', s2(2), 'num_dat', length(y2));

model.Pclass{1} = mlcgmm(data1);
model.Pclass{2} = mlcgmm(data2);
model.Prior     = [length(classA1) length(classA2)] / (length(classA1)+length(classA2));

ypred= bayescls(classTest', model);
failure = cerror(ypred, yTest, numClassTest);
success = 1-failure;

dfs(failure, success, numClassTest);

end
